Skip to content

casei: close the Unicode field gaps - #13

Merged
tsenart merged 24 commits into
masterfrom
perfloop/casei-field-closure
Aug 25, 2026
Merged

casei: close the Unicode field gaps#13
tsenart merged 24 commits into
masterfrom
perfloop/casei-field-closure

Conversation

@tsenart

@tsenart tsenart commented Aug 25, 2026

Copy link
Copy Markdown
Owner

Rebar exposed two competitive workloads that the original arena did not
contain: complete enumeration of a compiled multi-pattern Unicode plan, and
raw variable-width confirmation under dense fold hazards. Casei lost those
same-contract rows.

This change closes them without adding a second engine. The existing compiled
plan now combines tagged interior anchors, exact pair replay, raw one-, two-,
and three-byte fold confirmation, and an exact common-byte origin gate. The
same state machine still decides single- and multi-needle results. The arena
adds the omitted shapes and grows to 36 rows.

The repository now carries the explanation, novelty argument, ablations,
native reachability checks, and hash-linked raw receipts needed to audit the
result.

On three complete passes of the pinned field:

  • Ice Lake wins 36/36 rows; worst sample is 0.9736 x_vs_best and median
    speedup is 1.80x.
  • Sapphire Rapids wins 36/36 rows; worst sample is 0.9799 x_vs_best and median
    speedup is 1.56x.
  • Every one of the 216 BenchmarkBar samples is below 1.0, with 5-7 entrants
    per row. Casei and Vectorscan both dispatch at 512 bits with VBMI.
  • The independent Rebar audit wins all 5/5 rows with the same Unicode
    contract on both hosts.

The other 13 representable Rebar rows request ASCII-only folding. They remain
visible as different-contract stress data; casei wins 9/18 of the complete
set on each host and makes no all-18 claim.

The exact repaired source passed the full test suite, forced-scalar tests,
race tests, baseline isolation, native field agreement, GDB reachability for
all three changed kernels, receipt verification, and two independent final
reviews.

Perfloop case: https://app.perfloop.ai/t/oss/case_5pjer7jp50

perfloop-agent and others added 24 commits August 24, 2026 14:25
The original arena omitted multi-pattern enumeration and the hard Unicode shapes that exposed decoded confirmation cost. Rebar found three same-contract losses, including a roughly ninefold gap.

Add tagged multi-pattern candidates, width-aware raw confirmation, an exact common-byte origin gate, and wider AVX-512 schedules. Pair each field timing with its competitor and retain the two-host field, Rebar, ablation, and native-reachability receipts.

The resulting source wins every current arena row and all five same-contract Rebar rows on Ice Lake and Sapphire Rapids while preserving the simple-fold contract and portable fallback.
The library supports Go 1.22, while testing.B.Loop was added in Go 1.24. Keep the diagnostic benchmark and its B.Loop timing semantics without making the ordinary amd64 test file require a newer toolchain.
Go vet checks assembly stack operands against the declaration names. Name the two multi-value results so the existing ret, width, and tags operands match the Go ABI without changing the generated instruction stream.
The scalar confirmation fix changed the source after the previous two-host evidence was captured. Re-run the pinned field and Rebar on qualifying Ice Lake and Sapphire Rapids hosts, and bind the public claims and checksum receipts to the repaired implementation.\n\nBoth hosts win all 36 BenchmarkBar rows across three passes and all five same-contract Rebar rows.
The variable-confirmation test called its internal full-block kernel directly even when runtime dispatch would reject that path. Linux runners without AVX-512 therefore executed a VBMI instruction and trapped.\n\nKeep portable behavior coverage on every host, but make the direct vector assertion conditional on the same feature predicate as production dispatch.
The VBMI-only test guard changed the signed source stream after the previous receipts were recorded. Re-run both qualifying hosts and refresh the field, Rebar, native reachability, checksum, and public summary artifacts.\n\nEvery BenchmarkBar sample remains below 1.0 across 36 rows and three passes per host. The same-contract Rebar selection remains 5 for 5 on both hosts with pinned Hyperscan 5.4.2.
@tsenart
tsenart merged commit 3d07ca9 into master Aug 25, 2026
8 checks passed
@tsenart
tsenart deleted the perfloop/casei-field-closure branch August 25, 2026 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants